<!--
 * @Author: your name
 * @Date: 2022-02-10 11:46:18
 * @LastEditTime: 2022-03-28 09:46:20
 * @LastEditors: Please set LastEditors
 * @Description: 轮播图组件
-->
<template>
<div class="home-banner">
  <!-- 传轮播图的数据 -->
  <xtx-carousel autoPlay :bannerList="bannerList"/>
</div>
</template>

<script>
import { ref } from 'vue'
import { banner } from '../../../api/home'
export default {
  name: 'HomeBanner',
  setup () {
    // 定义轮播图数组,直接传给轮播图组件 方便直接修改数据
    const bannerList = ref([])
    banner().then(res => {
      bannerList.value = res.result
    })
    return {
      bannerList
    }
  }

}
</script>

<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98
}
.xtx-carousel {
  ::v-deep .carousel-btn.prev {
    left: 270px;
  }
  ::v-deep .carousel-indicator {
    padding-left: 250px;
  }
}
</style>
